// 混合
@import "mixins/prefix.less";
@import "mixins/common.less";

/************************** 通用动画相关 **************************/
.fade-enter-active {
    .prefix-animation( fade-show .3s linear );
}
.fade-leave-active {
    .prefix-animation( fade-hide .3s linear );
}
.prefix-keyframes(fade-show, {
    0% { opacity: 0; }
    100% { opacity: 1; }
});
.prefix-keyframes(fade-hide, {
    0% { opacity: 1; }
    100% { opacity: 0; }
});


.scale-enter-active {
    .prefix-animation( scale-show .3s ease-in );
}
.scale-leave-active {
    .prefix-animation( scale-hide .3s ease-out );
}
.prefix-keyframes(scale-show, {
    0% {
        opacity: 0;
        .prefix-transform( scale(0, 0) );
    }
    100% {
        opacity: 1;
        .prefix-transform( scale(1, 1) );
    }
});
.prefix-keyframes(scale-hide, {
    0% {
        opacity: 1;
        .prefix-transform( scale(1, 1) );
    }
    100% {
        opacity: 0;
        .prefix-transform( scale(0, 0) );
    }
});

.navs-enter-active {
    .prefix-transformorigin( left );
    .prefix-animation( navs-show .3s ease-out );
}
.navs-leave-active {
    position: absolute !important;
    .prefix-transformorigin( left );
    .prefix-animation( navs-hide .3s ease-out );
}
.prefix-keyframes(navs-show, {
    0% {
        opacity: 0;
        // .prefix-transform( scale(0, 1) );
        .prefix-transform( translateX(-20px) );
    }
    100% {
        opacity: 1;
        // .prefix-transform( scale(1, 1) );
        .prefix-transform( translateX(0) );
    }
});
.prefix-keyframes(navs-hide, {
    0% {
        opacity: 1;
        // .prefix-transform( scale(1, 1) );
        .prefix-transform( translateX(0) );
    }
    100% {
        opacity: 0;
        // .prefix-transform( scale(0, 1) );
        .prefix-transform( translateX(-20px) );
    }
});


.slide-enter-active {
    .prefix-transformorigin( left top );
    .prefix-animation( slide-down .15s linear );
}
.slide-leave-active {
    .prefix-transformorigin( left top );
    .prefix-animation( slide-up .15s linear );
}
.prefix-keyframes(slide-down, {
    0% {
        .prefix-transform( scale(1, 0) );
    }
    100% {
        .prefix-transform( scale(1, 1) );
    }
});
.prefix-keyframes(slide-up, {
    0% {
        .prefix-transform( scale(1, 1) );
    }
    100% {
        .prefix-transform( scale(1, 0) );
    }
});


.imodal-transition {}
.imodal-enter {
    .prefix-animation( margin-in .3s ease-out );
}
.imodal-leave {
    .prefix-animation( margin-out .3s ease-out );
}
.prefix-keyframes(margin-in, {
    0% { margin-top: -1000px; }
    100% { margin-top: 0; }
});
.prefix-keyframes(margin-out, {
    0% { margin-top: 0; }
    100% { margin-top: -1000px; }
});


.floatpad-transition {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
}
.floatpad-enter {
    .prefix-animation( right-in .3s ease-out );
}
.floatpad-leave {
    .prefix-animation( right-out .3s ease-in );
}
.prefix-keyframes(right-in, {
    0% { margin-right: -1000px; }
    100% { margin-right: 0; }
});
.prefix-keyframes(right-out, {
    0% { margin-right: 0; }
    100% { margin-right: -1000px; }
});


/************************* placeholder ************************/
.prefix-placeholder(#aaa);
input,
textarea {
    .prefix-placeholder(#aaa);
}



/************************** XScroll **************************/
.xscroll {
    position: relative;
    padding-right: 6px;
    padding-bottom: 6px;
    overflow: hidden !important;
    & > .xscroll-wrapper {
        position: absolute;
        top: 0px;
        bottom: 0px;
        left: 0px;
        right: 0px;
        // margin-right: 6px;
        // margin-bottom: 6px;
        overflow: hidden;
        // overflow: scroll;
        & > .xscroll-container {
            // position: absolute;
            // min-width: 100%;
            // display:inline-block;
            // *display:inline;
            // *zoom:1;
        }
    }
    & > .xscroll-bar {
        position: absolute;
        z-index: 1;
        background-color: rgba(240, 240, 240, 1);
        .prefix-user-select();
        .prefix-transition(background-color linear .15s);
        & > .xscroll-block {
            position: absolute;
            top: 0px;
            left: 0px;
            cursor: pointer;
            background-color: rgba(190, 190, 190, 1);
            .prefix-transition(~"background-color linear .15s, width linear .05s, height linear .05s");
        }
        &.xscroll-x {
            bottom: 0px;
            left: 0px;
            right: 0px;
            height: 6px;
            .xscroll-block {
                left: 0px;
                top: 0px;
                height: 6px;
            }
        }
        &.xscroll-y {
            top: 0px;
            bottom: 0px;
            right: 0px;
            width: 6px;
            .xscroll-block {
                top: 0px;
                left: 0px;
                width: 6px;
            }
        }
        &.active {
            background-color: rgba(220, 220, 220, 1);
            .xscroll-block {
                background-color: rgba(120, 120, 120, 1);
            }
        }
    }
}

/* xscroll皮肤 */
.xscroll-light,
.xscroll-dark {
     padding:10px 12px 12px 10px;
    & > .xscroll-wrapper {
        margin: 0;
    }
    & > .xscroll-bar {
        .prefix-border-radius(.5em);
        .xscroll-block {
            .prefix-border-radius(.5em);
        }
        &.xscroll-x {
            bottom: 4px;
            height: 4px;
            .xscroll-block {
                height: 4px;
            }
        }
        &.xscroll-y {
            right: 4px;
            width: 4px;
            .xscroll-block {
                width: 4px;
            }
        }
        &.active {
            background-color: rgba(0, 0, 0, .1);
        }
    }
}
.xscroll-light {
    & > .xscroll-bar {
        background-color: rgba(0, 0, 0, .06);
        & > .xscroll-block {
            background-color: rgba(190, 190, 190, 1);
        }
        &.active {
            background-color: rgba(0, 0, 0, .1);
            & > .xscroll-block {
                background-color: rgba(120, 120, 120, 1);
            }
        }
    }
}
.xscroll-dark {
    & > .xscroll-bar {
        background-color: rgba(0, 0, 0, .1);
        & > .xscroll-block {
            background-color: rgba(0, 0, 0, .4);
        }
        &.active {
            background-color: rgba(0, 0, 0, .2);
            & > .xscroll-block {
                background-color: rgba(0, 0, 0, .6);
            }
        }
    }
}

/************************** XColorPicker **************************/
.xcolorpicker {
    display: inline-block;
    position: relative;
    height: 18px;
    width: 18px;
    border: 1px solid rgb(120,120,120);
    cursor: pointer;
    .prefix-transition();
    &:hover {
        border-color: rgb(90,90,90);
        .prefix-box-shadow();
    }
    .xcolorpicker-handle {
        height: 16px;
        width: 16px;
        border: 1px solid rgb(240,240,240);
        background-color: rgb(255,0,0);
        &::before {
            position: absolute;
            top: 0;
            right: 0;
            display: block;
            content: ' ';
            border-top: 6px solid rgb(255,255,255);
            border-left: 6px solid transparent;
            border-bottom: 0;
            border-right: 0;
        }
    }
    .xcolorpicker-wrapper {
        display: none;
        position: absolute;
        top: 19px;
        left: 0;
        width: 355px;
        height: 200px;
        background: rgb(255, 255, 255);
        .prefix-border-radius(.3em);
        .prefix-box-shadow(0 15px 30px 0 rgba(0,0,0, .3));
        .xcolorpicker-colorpad {
            position: absolute;
            top: 10px;
            left: 10px;
            width: 180px;
            height: 180px;
            overflow: hidden;
            border: 1px solid rgb(240,240,240);
            // .prefix-gradient(~'90deg, rgb(255,255,255), rgb(255,0,0)');
            .colorpad-light {
                position: absolute;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                .prefix-gradient(~'-90deg, rgba(255,255,255, 0), rgba(255,255,255, 1)');
            }
            .colorpad-dark {
                position: absolute;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                .prefix-gradient(~'180deg, rgba(0,0,0, 0), rgba(0,0,0, 1)');
            }
            .pointer {
                position: absolute;
                top: -5px;
                left: -5px;
                width: 10px;
                height: 10px;
                border: 1px solid rgb(0,0,0);
                .prefix-border-radius(1em);
            }
        }
        .xcolorpicker-rainbow {
            position: absolute;
            top: 10px;
            left: 200px;
            width: 20px;
            height: 180px;
            background: rgb(255,255,255);
            .rainbow-color {
                position: absolute;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                .prefix-gradient(~'180deg, rgb(255,0,0), rgb(255,0,255), rgb(0,0,255), rgb(0,255,255), rgb(0,255,0), rgb(255,255,0), rgb(255,0,0)');
            }
            .pointer {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                // border: 1px solid rgb(255,255,255);
                &::before {
                    position: absolute;
                    top: -3px;
                    left: -7px;
                    height: 0;
                    display: block;
                    content: " ";
                    border-top: 3px solid transparent;
                    border-bottom: 3px solid transparent;
                    border-right: 0;
                    border-left: 6px solid rgb(90, 90, 90);
                }
            }
        }
        .xcolorpicker-values {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 112px;
            height: 100px;
            // border: 1px solid #eee;
            .values-hex {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                height: 22px;
                // border: 1px solid #f00;
            }
            .values-rgb {
                position: absolute;
                top: 25px;
                left: 0;
                right: 60px;
                // border: 1px solid #f00;
            }
            .values-hsb {
                position: absolute;
                top: 25px;
                left: 60px;
                right: 0;
                // border: 1px solid #f00;
            }
            .value-item {
                position: relative;
                margin-bottom: 5px;
                padding-left: 16px;
                height: 20px;
                font-size: 0;
                .tit {
                    position: absolute;
                    top: 0;
                    left: 0;
                    display: block;
                    width: 16px;
                    height: 20px;
                    line-height: 20px;
                    font-size: 12px;
                }
                .txt {
                    width: 100%;
                    height: 20px;
                    font-size: 14px;
                }
            }
        }
        .xcolorpicker-block {
            position: absolute;
            top: 120px;
            right: 10px;
            width: 112px;
            height: 30px;
            // border: 1px solid #f00;
            font-size: 0;
            .block-box {
                position: absolute;
                width: 56px;
                height: 30px;
                padding: 1px;
                border: 1px solid rgb(240,240,240);
                // .prefix-box-shadow();
                &.block-box-new {
                    top: 0;
                    left: 0;
                }
                &.block-box-old {
                    top: 0;
                    left: 55px;
                    width: 57px;
                }
                .block-color,
                .block-color {
                    position: absolute;
                    top: 0;
                    bottom: 0;
                    left: 0;
                    right: 0;
                }
            }
        }
        .xcolorpicker-btns {
            position: absolute;
            bottom: 10px;
            right: 10px;
            .btns-cancel,
            .btns-submit {

            }
        }
    }
    &.open {
        .xcolorpicker-wrapper {
            display: block;
        }
    }
}





/************************** 通用 **************************/
.wrapper {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}
.wrapper-scroll {
    overflow-y: auto;
}

